package com.myjoje.bean.system;

import com.myjoje.base.BaseUuidBean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * 菜单
 */
@Entity
@Table(name = "sy_menu")
public class MenuBean extends BaseUuidBean {

    //显示
    public final static String STATUS_SHOW = "1";
    //隐藏
    public final static String STATUS_HIDE = "0";

    //公用
    public final static String FLAG_PUB = "0";
    //标识一
    public final static String FLAG_ONE = "1";
    //标识二
    public final static String FLAG_TWO = "2";


    @Column(columnDefinition = "varchar(40) COMMENT '菜单名称'")
    private String label;

    @Column(columnDefinition = "varchar(40) COMMENT '菜单地址'")
    private String path;

    @Column(columnDefinition = "varchar(40) COMMENT '父id'")
    private String parentId;

    @Column(columnDefinition = "varchar(40) COMMENT '菜单图标'")
    private String icon;

    @Column(columnDefinition = "varchar(40) COMMENT '优先级，数字越小优先级越高'")
    private String priority;

    @Column(columnDefinition = "varchar(40) COMMENT '菜单状态0-隐藏，1-显示'")
    private String status;

    @Column(columnDefinition = "varchar(40) COMMENT '菜单标志，0-公用，1-社团，2-德育'")
    private String flag;

    //字列表
    @Transient
    private List children;

    //层级关系
    @Transient
    private String hierarchy;

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public Object getChildren() {
        return children;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getPriority() {
        return priority;
    }

    public void setPriority(String priority) {
        this.priority = priority;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public static String getStatusShow() {
        return STATUS_SHOW;
    }

    public static String getStatusHide() {
        return STATUS_HIDE;
    }

    public static String getFlagPub() {
        return FLAG_PUB;
    }

    public static String getFlagOne() {
        return FLAG_ONE;
    }

    public static String getFlagTwo() {
        return FLAG_TWO;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public void setChildren(List children) {
        this.children = children;
    }

    public String getHierarchy() {
        return hierarchy;
    }

    public void setHierarchy(String hierarchy) {
        this.hierarchy = hierarchy;
    }
}
